import 'package:flutter/material.dart';

/// 导航项数据类 - Navigation item data class
/// 简单的导航项数据结构，包含图标和标题
/// Simple navigation item data structure with icon and title
class NavItem {
  final IconData icon;
  final String title;

  const NavItem({
    required this.icon,
    required this.title,
  });
}

/// 根页面状态管理 - Root State Management
///
/// 管理根页面（底部导航）的所有状态变量
/// Manages all state variables for root page (bottom navigation)
///
/// 基于GetX最佳实践，使用不可变状态模式
/// Based on GetX best practices, using immutable state pattern
class RootState {
  /// 当前选中的页面索引 - Current selected page index
  int currentIndex;

  /// 是否正在加载 - Whether loading
  bool isLoading;

  /// 错误信息 - Error message
  String? errorMessage;

  /// 页面标题列表 - Page titles list
  final List<String> pageTitles;

  /// 是否显示底部导航栏 - Whether to show bottom navigation bar
  bool showBottomNav;

  /// 底部导航栏项目列表 - Bottom navigation bar items list
  final List<NavItem> navItems;

  /// 构造函数 - Constructor
  RootState({
    this.currentIndex = 0,
    this.isLoading = false,
    this.errorMessage,
    this.pageTitles = const ['首页', '万年历', '课堂', '我的'],
    this.showBottomNav = true,
    this.navItems = const [
      NavItem(
        icon: Icons.home_outlined,
        title: '首页',
      ),
      NavItem(
        icon: Icons.calendar_today_outlined,
        title: '万年历',
      ),
      NavItem(
        icon: Icons.school_outlined,
        title: '课堂',
      ),
      NavItem(
        icon: Icons.person_outlined,
        title: '我的',
      ),
    ],
  });
}
